package com.example.lovedogs.fragment;


import com.example.lovedogs.R;
import com.example.lovedogs.gouquan.Hulizhuanlan;
import com.example.lovedogs.gouquan.Mengchongshequ;
import com.example.lovedogs.gouquan.Mengyoulijian;
import com.example.lovedogs.gouquan.Wendaguangchang;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.TextView;
import android.widget.Toast;

public class GouquanFragment extends Fragment implements View.OnClickListener{
	private FrameLayout mFrameLayout_mengyou ;//萌友力荐
	private FrameLayout mFrameLayout_huli ;//护理专栏
	private FrameLayout mFrameLayout_wenda ;//问答广场
	private FrameLayout mFrameLayout_mengchong ;//萌宠社区
//	private TextView tv_mengyou ;
//	private TextView tv_huli ;
//	private TextView tv_wenda ;
//	private TextView tv_mengchong ;
	 @Override
		public View onCreateView(LayoutInflater inflater, ViewGroup container,
				Bundle savedInstanceState) {
			View rootView = inflater.inflate(R.layout.fragment_gouquan, container, false);
			
			mFrameLayout_mengyou =  (FrameLayout) rootView.findViewById(R.id.framelayout1);
			mFrameLayout_huli = (FrameLayout) rootView.findViewById(R.id.framelayout2);
			mFrameLayout_wenda = (FrameLayout) rootView.findViewById(R.id.framelayout3);
			mFrameLayout_mengchong = (FrameLayout) rootView.findViewById(R.id.framelayout4);
//			tv_mengyou = (TextView) rootView.findViewById(R.id.gouquan_1);
//			tv_huli = (TextView) rootView.findViewById(R.id.gouquan_2);
//			tv_wenda = (TextView) rootView.findViewById(R.id.gouquan_3);
//			tv_mengchong = (TextView) rootView.findViewById(R.id.gouquan_4);
			
			mFrameLayout_mengyou.setOnClickListener(this);
			mFrameLayout_huli.setOnClickListener(this);
			mFrameLayout_wenda.setOnClickListener(this);
			mFrameLayout_mengchong.setOnClickListener(this);
			
			return rootView;
		}
	
	
	@Override
	public void onClick(View view) {
		int id = view.getId();
		if(R.id.framelayout1 == id){//跳转到萌友力荐
			Intent intent = new Intent();
			intent.putExtra("type","萌友力荐");
			intent.setClass(getActivity(), Mengyoulijian.class);
			startActivity(intent);
		}else if(R.id.framelayout2 == id){//跳转到护理专栏
			Intent intent = new Intent();
			intent.setClass(getActivity(), Hulizhuanlan.class);
			startActivity(intent);
		}else if(R.id.framelayout3 == id){//跳转到问答广场
			Intent intent = new Intent();
			intent.setClass(getActivity(), Wendaguangchang.class);
			startActivity(intent);
		}else if(R.id.framelayout4 == id){//跳转到萌宠社区
			Intent intent = new Intent();
			intent.setClass(getActivity(), Mengchongshequ.class);
			startActivity(intent);
		}
	}
	
	
}
